import Vue, { KeepAlive } from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home/HomeMenu.vue'),
    children:[
      {
        path:'/front',
        component: () => import('../components/module_components/Carousel.vue')
      },
      {
        path:'/grade_panel',
        component: () => import('../views/student/GradePanel.vue')
      },
      {
        path:'/user_info',
        component: () => import('../views/personal/PersonalInfo.vue')
      },
      {
        path:'/users_manage',
        component: () => import('../views/admin/AccountManage.vue')
      },
      {
        path:'/pub_asign',
        component: () => import('../views/teacher/PubAsign.vue')
      },
      {
        path:'/pub_work',
        component: () => import('../views/teacher/HomeworkPublish.vue')
      },
      {
        path:'/work_panel',
        component:() => import('../views/student/WorkPanel.vue')
      },
      {
        path:'/points_panel',
        component:() => import('../views/student/PointsPanel.vue')
      },
      {
        path:'/gonggao',
        component:() => import('../views/admin/GongGao.vue')
      },
      {
        path:'/subject_manage',
        component:() => import('../views/admin/SubjectManage.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/LoginView.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
